\ProvidesPackageRCS $Header:
/cvsroot/latex-beamer/latex-beamer/themes/theme/beamerthemeAUTheme.sty,v
1.10 2004/10/07 20:53:10 bourke Exp $

% This theme modifies the PaloAlto, sidebar, and sidebartab beamer themes
% Modifications by Chris Bourke
% Last modified 3/7/05

%% Modifictaions to above and Til Tantau's beamer themes to conform to AU
%% colors by Manu Parmar, Feb. 2007


% BEGIN sidebar dimension setup
\newdimen\beamer@sidebarwidth
\newdimen\beamer@headheight
%\newdimen\beamer@headheight1
\usebeamerfont{frametitle}
\beamer@sidebarwidth=2.5\baselineskip
\beamer@headheight=2.5\baselineskip%控制左侧蓝色侧边的高度
%\beamer@headheight1=1.2\baselineskip
\reset@font

\def\beamer@lefttext{left}
\definecolor{AU@Orange}{RGB}{255, 150, 0}

% Package options

\DeclareOptionBeamer{hideothersubsections}[]{\beamer@nav@subsectionstyle{show/show/hide}}
\DeclareOptionBeamer{hideallsubsections}[]{\beamer@nav@subsectionstyle{hide}}

\DeclareOptionBeamer{width}{\beamer@sidebarwidth=#1}
\DeclareOptionBeamer{height}{\beamer@headheight=#1}
\DeclareOptionBeamer{left}{\def\beamer@sidebarside{left}}
\DeclareOptionBeamer{right}{\def\beamer@sidebarside{right}}
\ExecuteOptionsBeamer{left}
\ProcessOptionsBeamer

% Default mode (<presentation> encompasses <beamer>, <handout>, and <trans> (transparencies))
\mode<beamer>
%\mode<handout>

% All Beamer Boxes will be rounded with a drop shadow
\useinnertheme[shadow=true]{rounded}
%\useinnertheme{circles}

% cut-pasted-n-hacked sidebar theme
\ifdim\beamer@headheight>0pt
% if head height is 0pt, use default frame title

  \setbeamercolor*{frametitle}{parent=sidebar}

  \defbeamertemplate*{frametitle}{sidebar theme}
  {%
    \nointerlineskip%
%    \vskip-\beamer@headheight%
    \vskip-1.5cm%
%    \vbox to \beamer@headheight{%
    \vbox to 0.5cm{%控制页面标题与正文间的距离
      \vfil
      \leftskip=-\beamer@leftmargin%
      \advance\leftskip by0.3cm%
      \rightskip=-\beamer@rightmargin%
      \advance\rightskip by0.3cm plus1fil%
      {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
      {\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
      \vbox{}%
      \vskip-1em%
      \vfil
    }%
  }

  \defbeamertemplate*{headline}{sidebar theme}
  {%
    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \ifx\beamer@sidebarside\beamer@lefttext%
      \else%
        \hfill%
      \fi%
      \ifdim\beamer@sidebarwidth>0pt%
        \usebeamercolor[bg]{logo}%
        \vrule width \beamer@sidebarwidth height \beamer@headheight%侧面边条上的颜色短线？
        \hskip-\beamer@sidebarwidth%
        \hbox to \beamer@sidebarwidth{\hss\vbox to
          \beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
      \else%
        \vrule width0pt height \beamer@headheight%
      \fi%
    \end{beamercolorbox}
  }
\fi

%%%左侧目录标题
\def\beamer@sidebarformat#1#2#3{%
  \begin{beamercolorbox}[wd=\beamer@sidebarwidth,leftskip=#1,rightskip=1ex plus1fil,vmode]{#2}
%    \vbox{}%
    #3\par%
%    \vbox{}%
%    \vskip-1.5ex%
  \end{beamercolorbox}
}

\defbeamertemplate*{section in sidebar}{sidebar theme}
{%
  \vbox{%
    \vskip2ex%标题间距
    \beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionhead}%
  }%
}

\defbeamertemplate*{section in sidebar shaded}{sidebar theme}
{%
  \vbox{%
    \vskip2ex%标题间间距
    \beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}%
  }%
}

\ifdim\beamer@sidebarwidth>0pt

                                % Sidebar
  \setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}
  \defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
  {
    \beamer@tempdim=\beamer@sidebarwidth%
    \advance\beamer@tempdim by -6pt%
    {\usebeamerfont{title in sidebar}%
      \vskip1.5em%
      \hskip3pt%
      \usebeamercolor[fg]{title in sidebar}%
      \insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\par%
      \vskip1.25em%
    }%
    {%
      \hskip3pt%
      \usebeamercolor[fg]{author in sidebar}%
      \usebeamerfont{author in sidebar}%
      \insertshortauthor[width=\beamer@tempdim,center,respectlinebreaks]\par%
      \vskip1.25em%
    }%
    \insertverticalnavigation{\beamer@sidebarwidth}%
    \vfill
    \ifx\beamer@sidebarside\beamer@lefttext%
    \else%
      \usebeamercolor{normal text}%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt%
    \fi%
  }%

  \ifx\beamer@sidebarside\beamer@lefttext%
    \defbeamertemplate*{sidebar right}{sidebar theme}
    {%
      \vfill%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt}
  \fi
                                % Margins
  \setbeamersize{text margin left=0.5cm,text margin right=0.5cm}
\fi

%\usecolortheme{sidebartab} cut-pasted-n-hacked:
\setbeamercolor*{section in sidebar shaded}{parent=palette sidebar secondary}
\setbeamercolor*{section in sidebar}
  {parent=section in sidebar shaded,use={sidebar,section in sidebar shaded},%
   fg=AU@Orange,bg=AU@Blue}

\setbeamercolor*{subsection in sidebar shaded}{parent=palette sidebar primary}
\setbeamercolor*{subsection in sidebar}
  {parent=subsection in sidebar shaded,use=section in sidebar,%
   bg=section in sidebar.bg, % We simply inherit the section properties
   fg=section in sidebar.fg} % Here too.

% We use *part* of the outer theme "shadow" but without the "split" theme
% This gives us a (hacked) drop shadow on the sidebar and frametitle bar
\pgfdeclarehorizontalshading[frametitle.bg,frametitle right.bg]{beamer@frametitleshade}{\paperheight}{%
  color(0pt)=(frametitle.bg);
  color(\paperwidth)=(frametitle right.bg)}

% section page ----------------------------------------------------------------
%\definecolor{CampusGold}{HTML}{00509E}%%%西工大蓝
%\definecolor{MoonDustGray}{HTML}{D3D3D3}%%%工大银
%\setbeamercolor{CampusGold}{bg=CampusGold}
%\setbeamercolor{PurdueMoonDustGray}{bg=MoonDustGray}
\AtBeginSection{%
\begin{frame}
\hspace*{-0.2\linewidth}
\begin{minipage}[t]{\the\paperwidth}
  \hbox{%
    \begin{beamercolorbox}[
      wd=0.1\linewidth,
      ht=0.1\linewidth,
      dp=0.02\linewidth]{PurdueMoonDustGray}
    \end{beamercolorbox}
    \begin{beamercolorbox}[
      wd=0.9\linewidth,
      ht=0.05\linewidth,
      dp=0.02\linewidth,
      sep=0.8em]{CampusGold}
      {\usebeamerfont{frametitle} \usebeamercolor[fg]{frametitle}
        % change here to change "Part" to "Section" or so
        Chapter \insertsectionnumber: \insertsection}%
    \end{beamercolorbox}
  }%
\end{minipage}
\end{frame}
}%

\AtBeginDocument{
  %
  \pgfdeclareverticalshading{beamer@topborder}{\paperwidth}{%
    color(0pt)=(black);
    color(1pt)=(black)}
  \pgfdeclarehorizontalshading{beamer@sideborder}{\paperheight}{%
    color(0pt)=(black);
    color(1pt)=(black)}

  \pgfdeclareverticalshading{beamer@topshade}{\paperwidth}{%
    color(0pt)=(bg);
    color(4pt)=(black!50!bg)}
  \pgfdeclareverticalshading{beamer@topshadesidebarcover}{\beamer@sidebarwidth}{%
    color(0pt)=(AU@Orange);
    color(4pt)=(AU@Orange)}
  \pgfdeclareverticalshading{beamer@topshadesidebarcoverwhite}{6pt}{%
    color(0pt)=(white);
    color(4pt)=(white)}

  \pgfdeclarehorizontalshading{beamer@sideshade}{\paperheight}{%
    color(0pt)=(black!50!bg);
    color(4pt)=(bg)}
% An attempt at getting the shadings to meet nicely, FAILED
%  \pgfdeclarehorizontalshading{beamer@sidediagshade}{5.66pt}{%
%    color(0pt)=(green!50!bg);
%    color(5.66pt)=(bg)}
}

\addtobeamertemplate{headline}
{}
{%
%  \vskip-0.2pt
%drop-shadow:
%old: \hskip\beamer@sidebarwidth\hskip.2cm\pgfuseshading{beamer@topshade}
%\hskip\beamer@sidebarwidth\pgfuseshading{beamer@topshadesidebarcoverwhite}\pgfuseshading{beamer@topshade}
%border: \hskip\beamer@sidebarwidth\hskip.2cm\pgfuseshading{beamer@topborder}
% Attempted to combine two drop shadows in a transition, failed
%*** TRY HERE INSTEAD: declare a horizontal shade, rotate it 45 degrees and clip it.
%  \pgfmoveto{\pgfxy{0,0}}
%  \pgflineto{\pgfxy{0,-2}}
%  \pgflineto{\pgfxy{-2,-2}}
%  \pgflineto{\pgfxy{2,-2}}
%  \pgflineto{\pgfxy{2,2}}
%  \pgflineto{\pgfxy{2,0}}
%  \pgflineto{\pgfxy{0,0}}
%  \pgfclip
  \vskip-4pt
  \pgfuseshading{beamer@topshadesidebarcover}
  \vskip-2pt
}

% Add page numbering to bottom left.
\addtobeamertemplate{footline}
{%
   \usebeamercolor[fg]{author in sidebar}
   \vskip-1cm\hskip10pt
%  \insertpagenumber\,/\,\insertpresentationendpage\kern1em\vskip2pt%
  \insertpagenumber\, of \,$\infty$\kern1em\vskip2pt%
}

\addtobeamertemplate{sidebar \beamer@sidebarside}
{}
{
%Want to "rewind" to the top of the sidebar, but how?
%drop-shadow:
\vskip-\paperwidth\hskip\beamer@sidebarwidth\pgfuseshading{beamer@sideshade}
%border: \vskip-\paperwidth\hskip\beamer@sidebarwidth\pgfuseshading{beamer@sideborder}
}
% End Shadow

%\usecolortheme[RGB={17,17,140}]{structure}

% Complete color themes:
% albatross, beetle, crane, dove, fly, seagull

% Inner color themes:
% lily, orchid, rose

% Outer color themes:
% whale, seahorse, dolphin(?)

\usecolortheme{orchid} % Establishes inner, dark colors
\usecolortheme{whale}  % Establishes outer, dark colors
%\usecolortheme{dove}

% Customized Various Color elements:
\setbeamercolor{titlelike}{fg=white,bg=AU@Orange} %
\setbeamercolor{sidebar}{fg=AU@Blue}              %
\setbeamercolor{frametitle}{fg=AU@Blue, bg=white}           %标题背景色
\setbeamercolor{title in sidebar}{fg=white}      %
\setbeamercolor{author in sidebar}{fg=white}    %
%\setbeamercolor{section in sidebar}{fg=yellow}     These two do not load (are overwritten) if
%\setbeamercolor{subsection in sidebar}{fg=yellow}  you use the sidebartab
\setbeamercolor{section in sidebar shaded}{fg=white}
\setbeamercolor{subsection in sidebar shaded}{fg=AU@Blue}
%
\setbeamercolor{itemize item}{fg=black}
%
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{block body}{fg=black}
\setbeamercolor{math text}{fg=black,bg=AU@VeryLightGrey}
%
%\setbeamercolor{structure}{fg=beamer@blendedred}
%
%\setbeamertemplate{blocks}[rounded]{shadow=true}
\setbeamercolor{block title}{fg=black,bg=white}
\setbeamercolor{block body}{fg=black,bg=AU@VeryLightGrey}

% Set the AU logo, file must be in the latex path or working directory
\setbeamercolor{logo}{fg=black,bg=white}
%\logo{\includegraphics[height=1.25cm]{AUlogo3-crop.pdf}}
\logo{\includegraphics[height=1.7cm]{npulogolib.pdf}}

% Handout Mode - Using the default layouts, no menus, etc.
\mode
<handout>
\usetheme{default}
\usecolortheme{default}
\setbeamertemplate{navigation symbols}{}
\useinnertheme{default}
%reset shadow boxes to very light grey
\setbeamercolor{block title}{fg=black,bg=AU@LightGrey} %
\setbeamercolor{block body}{fg=black,bg=AU@VeryLightGrey} %

% Settings for every mode
\mode
<all>
%Two horrible hacks to get a "note page" after every slide.
\newcommand{\noteframe}{
\only<handout>{ %
  \begin{frame}
   \frametitle{Notes}
   \begin{center}
   \begin{tikzpicture}
    \foreach \y in {0,1,2,3,4,5,6}
     \draw[thick] (0,\y) -- (11,\y);
   \end{tikzpicture}
   \end{center}
  \end{frame}
  }%
}

\newcommand{\noteslide}{%to be used after every \framebreak
\only<handout>{ %
   \begin{center}
   \begin{tikzpicture}
    \foreach \y in {0,1,2,3,4,5,6}
     \draw[thick] (0,\y) -- (11,\y);
   \end{tikzpicture}
   \end{center}
   \framebreak
   }%
}

% We declare the main color theme: Orange & Blue
%\definecolor{taorange}{rgb}{0.98824, 0.68627, 0.24314}
%\definecolor{AU@Orange}{RGB}{140,17,17}
\definecolor{AU@Orange}{RGB}{255, 150, 0}
% Alternate AU@Reds: 204,0,0 (AU.edu) <--seems to be the best
%                     240,7,46 (logo)
%                     255,25,25 (original)
%                     140,17,17 ("Orange")
%\definecolor{AU@Blue}{RGB}{245,240,219}
\definecolor{AU@Blue}{RGB}{17,17,175}
%Blue          245  240  219
%Blue2         245  255  250 - Whitest
%Dairy Blue    249  228  188 - more peachy
%Blue Brulee   255  229  160 - peach
%Blue Can      245  200   92 - Almost a peach
%Coconut Blue  248  247  220 - More white
\definecolor{AU@DarkGrey}{RGB}{35,35,35}
\definecolor{AU@Grey}{RGB}{100,100,100}
\definecolor{AU@LightGrey}{RGB}{200,200,200}
\definecolor{AU@VeryLightGrey}{RGB}{225,225,225}


% so we override example (greenish) and alerted (redish)
%\setbeamercolor{block title example}{fg=block title.fg,bg=block title.bg} %
%\setbeamercolor{block body example}{fg=block body.fg,bg=block body.bg} %
\setbeamercolor{block title example}{fg=black,bg=AU@LightGrey} %
\setbeamercolor{block body example}{fg=black,bg=AU@VeryLightGrey} %
\setbeamercolor{block title alerted}{fg=block title.fg,bg=block title.bg} %
\setbeamercolor{block body alerted}{fg=block body.fg,bg=block body.bg} %
\setlength{\parskip}{.1cm}
%\def\mathfamilydefault{\rmdefault}\beamer@sansmathfalse
%\usefonttheme[onlymath]{serif}
\beamertemplatetheoremsunnumbered  %This suppresses theorem numbers
%\setbeamertemplate{frametitle}[default][right]
